<script setup lang="ts">
import {storeToRefs} from "pinia";
import {computed, ComputedRef, h, reactive, ref} from "vue";
import katex from 'katex'
import {NButton, NConfigProvider, NEquation, NInput, NSelect} from "naive-ui";
import {useSgesAStore} from "./storeSgesCalA.ts";
import {utils} from "yklib";
const {  base_data, generateOptions, ropeData} = utils;
const store = useSgesAStore()
const {
  etaCharge_100,
  etaDischarge_100,
  etaSystem_100,
  capChargeTotalSta,
  capDischargeTotalSta,
  powerChargeTotalSta,
  totalChargeTime,
  cal_power,
  vibrant_para,
  vibrant_option,
  heightTower,
  density,
  lengthBlock,
  widthBlock,
  heightBlock,
  etaSystem,
  volumeBlock,
  massBlock,
  etaCharge,
  etaDischarge,
  numOfTowers,
  numOfGroups,
  numBlocksPerGroup,
  totalBlocksNum,
  totalMassBlocks,
  totalGravityEnergy,
  g,
  totalGravityEnergy_MJ,
  weightBlock,
  totalMassAssistance_t,
  totalMassAssistance,
  totalWeightAssistance,
  pillar_set,
  diameter_pillar,
  rowWeightPerTower,
  colWeightPerTower,
  numBlocksPerTower,
  distancePillarWeight,
  widthGenRegion,
  widthSingleTower,
  lengthSingleTower,
  areaSingleTower,
  areaControlRoom,
  areaTotalTower,
  areaTotalSta,
  areaCoe,
  timeSinglePass,
  proSim,
  velWeight_m_s,
  speedRotateGen,
  powerSingleBlock,
  powerSingleBlock_MW,
  speedRatio1,
  chargePowerSingleGen,
  disChaPowerSingleGen,
  chargePowerSingleGen_MW,
  disChaPowerSingleGen_MW,
  chargePower,
  disChaPower,
  torqueMainShaft,
  powerBlocksSim,
  speedHMinorShaft,
  powerMinorShaft,
  torqueHMinorShaft,
  numRopePerBlock,
  numPulleyPerRope,
  forceRope,
  diameterRope_mm,
  safetyRatioRope,
  forceRopeBreak,
  lvlRope,
  ropeCoreClass,
  ropeCoreClasses,
  ropeClass,
  ropeClasses,
  ropeStrands,
  ropeStrand,
  dMainShaft_mm,
  dMinorShaftH_mm,
  ropeTripTimes,
  lengthRopeGuidance,
  lengthRopeTrips,
  lengthRope,
  velRope,
  diameterReel,
  lengthReel,
  girthReel,
  speedLMinorShaft,
  dMinorShaft_mm,
  speedRatio2,
  massRopePer100,
  massSingleRope,
  massRopes,
  lengthMainShaft,
  numMainShaft,
  massMainShaft,
  massMainShafts,
  lengthMinorShaftH,
  numMinorShaftH,
  massMinorShaftH,
  massMinorShaftHs,
  lengthMinorShaftL,
  numMinorShaftL,
  massMinorShaftL,
  massMinorShaftLs,
  numRopeLaps,
  numLapsPerLayer,
  numRopeLayers,
  lengthMinorShaftL0,
  massMinorShaftL0,
  numMinorShaftL0,
  massMinorShaftL0s,
  massShaftTotal,
  massTotalShaftAndRopes,
  priceRope,
  priceShaft,
  priceRopes,
  priceShafts,
  calInfo,
  numGroupsSim,
} = storeToRefs(store)


const show_pillar_settings = ref(false)
const show_area_settings = ref(false)

type rowType = {
  key: number,
  item: string,
  symbol: string,
  unit: string,
  formula: string,
  val: number,
  bak: string
}

const editableVal = [  // 可以编辑的数值行
  // "钢丝绳安全系数", "动滑轮数量", "单个重物钢丝绳数量","发电机转速",
  // "螺伞齿轮箱变速比",
  "重物块与壁面预留距离", "发电机预留宽度", "集控室占地面积",
  "面积裕度系数", "钢丝绳导向段长度", "钢丝绳单价", "轴单价",
  "",
]

const editableSel = [  // 可以编辑的下拉列表行
  "钢丝绳级", "钢丝绳芯类型", "钢丝绳类型", "钢丝绳股型号"
]

const sepRow = [
  "发电机计算", "轴的重量计算", "卷筒计算", "价格计算", "钢丝绳计算",
]

const columns = () => {
  return [

    {
      title: "项目", key: 'item',
      render(row: rowType) {
        if (row.item === "重物有效提升高度") {
          return h("span", {style: "color: red"}, row.item)
        } else {
          return h("span", {}, row.item)
        }
      }
    },
    {
      title: "符号", key: 'symbol',
      render(row: rowType) {
        return h(NConfigProvider, {katex: katex as any},
            () => h(NEquation, {value: row.symbol, katexOptions: {output: "mathml"}}))
      }
    },
    {
      title: "单位", key: "unit"
    },
    {
      title: "公式", key: "formula",
      render(row: rowType) {
        if (row.item === "承重柱直径") {
          return h(NButton, {
            onclick: () => {
              show_pillar_settings.value = true
            }
          }, () => {
            return "承重柱设置"
          })
        } else if (row.item === "储能塔总占地面积") {
          return h(NButton, {
            onclick: () => {
              show_area_settings.value = true
            }
          }, () => {
            return "设置"
          })
        } else {
          return h(NConfigProvider, {katex: katex as any},
              () => h(NEquation, {value: row.formula, katexOptions: {output: "mathml"}}))
        }
      }
    },
    {
      title: "数值", key: "val",
      render(row: rowType, index: number) {
        if (row.item === "重物有效提升高度") {
          return h("span", {style: "color: red"}, row.val)
        } else if (editableVal.includes(row.item)) {
          return h(NInput, {
            value: String(row.val),
            ":options": {
              label: "1960",
              value: 1960
            },
            style: "background-color: lightgreen; padding-top: 0px; margin: 0px",
            onUpdateValue(v: string) {
              // @ts-ignore
              row.val = v // 此处不能加Number(v)，否则无法输入小数
            }
          })
        } else if (editableSel.includes(row.item)) {
          return h(NSelect, {
            value: String(row.val),
            style: "background-color: lightgreen; padding-top: 0px; margin: 0px",
            onUpdateValue(v: string) {
              row.val = Number(v)
            }
          })
        } else {
          return h("span", {}, row.val)
        }
      }
    },
    {
      title: "备注", key: "bak",
      render(row: rowType) {
        if (row.item === "承重柱直径") {
          return h('div', {}, [
            h("div", {}, row.bak),
            h("a", {
              href: "https://www.mohurd.gov.cn/gongkai/zhengce/zhengcefilelib/202107/20210715_761192.html",
              target: "_blank"
            }, "GB 55001《工程结构通用规范》"),
            h("div", {}, ""),
            h("a", {
              href: "https://www.mohurd.gov.cn/gongkai/zhengce/zhengcefilelib/202110/20211013_762454.html",
              target: "_blank"
            }, "GB 55008 《混凝土结构通用规范》"),
            h("div", {}, ""),
            h("a", {
              href: "https://www.mohurd.gov.cn/gongkai/zhengce/zhengcefilelib/202111/20211130_763200.html",
              target: "_blank"
            }, "GB/T 51446 《钢管混凝土混合结构技术标准》"),
          ])
        } else {
          return h("span", {}, row.bak)
        }
      },
    },

  ]
}

const tableData = ref([
  {
    key: 0,
    item: "储能容量",
    symbol: "Cap_t",
    unit: "MWh",
    formula: "from\\ design",
    val: capChargeTotalSta, // 不能带.value，否则会失去响应性
    bak: "设计边界条件"
  },
  {
    key: 1,
    item: "放电容量",
    symbol: "Cap_{td}",
    unit: "MWh",
    formula: "=Cap_t/eta_s",
    val: capDischargeTotalSta,
    bak: ""
  },
  {
    key: 1,
    item: "储能效率",
    symbol: "\\eta_s",
    unit: "%",
    formula: "from\\ design",
    val: etaSystem_100,
    bak: "电动发电机出口测量",
    children: [
      {
        key: 2,
        item: "充电效率",
        symbol: "\\eta_c",
        unit: "%",
        formula: "=sqrt(eta_s)",
        val: etaCharge_100,
        bak: "电动发电机出口测量"
      },
      {
        key: 3,
        item: "释能效率",
        symbol: "\\eta_d",
        unit: "%",
        formula: "=\\sqrt{\\eta_s}",
        val: etaDischarge_100,
        bak: "电动发电机出口测量"
      },
    ]
  },


  {
    key: 4,
    item: "重物有效提升高度",
    symbol: "H_T",
    unit: "m",
    formula: "=\\frac{1000000 M_s}{Weight_s}",
    val: heightTower,
  },
  {
    key: 4,
    item: "重物长",
    symbol: "H_T",
    unit: "m",
    formula: "from\\ design",
    val: lengthBlock,
  },
  {
    key: 4,
    item: "重物宽",
    symbol: "H_T",
    unit: "m",
    formula: "from\\ design",
    val: widthBlock,
  },
  {
    key: 4,
    item: "重物高",
    symbol: "H_T",
    unit: "m",
    formula: "from\\ design",
    val: heightBlock,
  },
  {
    key: 5,
    item: "单个重物体积",
    symbol: "Vol_s",
    unit: "m3",
    formula: "=L_s\\times W_s\\times H_s",
    val: volumeBlock
  },
  {
    key: 5,
    item: "重物密度",
    symbol: "Density_s",
    unit: "kg/m3",
    formula: "=L_s\\times W_s\\times H_s",
    val: density
  },
  {
    key: 6,
    item: "单个重物质量",
    symbol: "M_s",
    unit: "kg",
    formula: "=Vol_s\\times D_s",
    val: massBlock
  },
  {
    item: "单个重物重力",
    symbol: "Weight_s",
    unit: "N",
    formula: "=M_sg",
    val: weightBlock,
  },

  {
    item: "重物总数量",
    symbol: "n_w",
    unit: "个",
    formula: "=N_tN_gN_c",
    val: totalBlocksNum,
  },
  {
    key: 6,
    item: "重物总质量",
    symbol: "M_t",
    unit: "kg",
    formula: "=M_s\\times n_w",
    val: totalMassBlocks,
  },
  {
    key: 7,
    item: "重物可储存势能",
    symbol: "GE_t", // gravity energy _ total
    unit: "MJ",
    formula: "=Cap_t/eta_c",
    val: totalGravityEnergy_MJ,
  }, {},
  {
    key: 6,
    item: "塔群数量",
    symbol: "N_t",
    unit: "个",
    formula: "=from\\ design",
    val: numOfTowers,
  },
  {
    key: 6,
    item: "每个塔群中塔组数",
    symbol: "N_g",
    unit: "个",
    formula: "=from\\ design",
    val: numOfGroups,
  },
  {
    key: 6,
    item: "每个塔组中重物块数量",
    symbol: "N_c",
    unit: "个",
    formula: "=from\\ design",
    val: numBlocksPerGroup,
  },
  {
    key: 6,
    item: "每个塔群中重物行数",
    symbol: "r_{weight}",
    unit: "个",
    formula: "=from\\ design",
    val: rowWeightPerTower,
  },
  {
    key: 6,
    item: "每个塔群中重物列数",
    symbol: "c_{weight}",
    unit: "个",
    formula: "=2*N_c",
    val: colWeightPerTower,
  },
  {
    key: 6,
    item: "每个塔群中重物总数",
    symbol: "n_{wt}",
    unit: "个",
    formula: "=r_{weight} \\times c_{weight}",
    val: numBlocksPerTower,
  },

  {},
  {
    item: "承重柱直径",
    symbol: "D_p",
    unit: "m",
    formula: "",
    val: diameter_pillar,
    bak: "参考标准",
    children: [
      {
        item: "钢材材质",
        val: pillar_set.value.steelType
      },
      {
        item: "混凝土型号",
        val: pillar_set.value.concreteType
      },
      {
        item: "含钢率",
        symbol: "\\alpha",
        val: pillar_set.value.steelRatio
      }, {
        item: "钢材密度",
        val: pillar_set.value.steelDensity
      }
    ]
  },
  {
    key: 6,
    item: "电站需求总面积",
    symbol: "A_{room}",
    unit: "m2",
    formula: "=A_{room}+A_kA_{towers}",
    val: areaTotalSta,
    children: [
      {
        item: "重物块与壁面预留距离",
        symbol: "d_{pw}",
        unit: "mm",
        formula: "",
        val: distancePillarWeight,
      },
      {
        item: "发电机预留宽度",
        symbol: "W_{gen}",
        unit: "m",
        formula: "",
        val: widthGenRegion,
      },
      {
        key: 6,
        item: "单塔群长度",
        symbol: "L_{tower}",
        unit: "m",
        formula: "=c_{weight}(L_{weight}+2d_{pw})",
        val: lengthSingleTower,
      },
      {
        key: 6,
        item: "单塔群宽度",
        symbol: "L_{tower}",
        unit: "m",
        formula: "=from\\ design",
        val: widthSingleTower,
      },
      {
        item: "单塔群占地面积",
        symbol: "A_{group}",
        unit: "m^2",
        formula: "=m^2",
        val: areaSingleTower
      },
      {
        key: 6,
        item: "塔群总占地面积",
        symbol: "A_{towers}",
        unit: "m2",
        formula: "=L_{tower}N_t",
        val: areaTotalTower,
      },
      {
        key: 6,
        item: "集控室占地面积",
        symbol: "A_{room}",
        unit: "m2",
        formula: "=from\\ design",
        val: areaControlRoom,
      },
      {
        item: "面积裕度系数",
        symbol: "A_k",
        unit: "",
        formula: "",
        val: areaCoe,
        children: []
      },
    ]
  },

  {},

  {
    item: "总充电时间",
    symbol: "t_c",
    unit: "h",
    val: totalChargeTime,
  },
  {
    item: "设计同时运行重物占比",
    symbol: "t_d",
    unit: "",
    val: proSim,
  },
  {
    item: "单塔群同时运行塔列数",
    symbol: "t_d",
    unit: "",
    val: numGroupsSim,
  },
  {
    item: "单程运行时间",
    symbol: "t_sp",
    unit: "",
    val: timeSinglePass,
  },
  {
    item: "额定重物运行速度",
    symbol: "v_{bc}",
    unit: "m/s",
    val: velWeight_m_s
  },
  {
    item: "单重物运行功率",
    symbol: "P_{sb}",
    unit: "MW",
    formula: "=Weight_s \\times v_{bc}/1000000",
    val: powerSingleBlock_MW,
  },
  {
    item: "单塔群重物运行功率",
    symbol: "P_{sb}",
    unit: "MW",
    formula: "=Weight_s \\times v_{bc}/1000000",
    val: computed(() => powerBlocksSim.value / 1000000),
  },
  {
    item: "发电机计算",
    bak: "双出轴",
  },
  {
    item: "发电电动机充电功率",
    symbol: "P_gs",
    unit: "MW",
    val: chargePowerSingleGen_MW,
  },
  {
    item: "发电电动机发电功率",
    symbol: "P_gs",
    unit: "MW",
    val: disChaPowerSingleGen_MW,
  },
  {
    item: "总充电功率",
    symbol: "P_gs",
    unit: "MW",
    val: computed(() => chargePower.value / 1000000),
  },
  {
    item: "总发电功率",
    symbol: "P_gs",
    unit: "MW",
    val: computed(() => disChaPower.value / 1000000),
  },
  {
    item: "发电机转速",
    symbol: "S_r",
    unit: "rpm",
    val: speedRotateGen,
  },
  {
    item: "螺伞齿轮箱变速比",
    symbol: "k_1",
    unit: "",
    val: speedRatio1,
  },
  {
    item: "副轴齿轮箱变比",
    symbol: "r_{gear}",
    unit: "",
    val: speedRatio2,
  },
  {
    item: "主轴转速",
    symbol: "r_{gear}",
    unit: "",
    val: speedRotateGen,
  },
  {
    item: "主轴功率",
    symbol: "r_{gear}",
    unit: "MW",
    val: computed(() => chargePowerSingleGen.value / 2000000),
  },
  {
    item: "主轴扭矩",
    symbol: "Torque_{ms}",
    unit: "Nm",
    val: torqueMainShaft,
  },
  {
    item: "主轴直径",
    symbol: "d_{ms}",
    unit: "mm",
    val: dMainShaft_mm,
  },
  {
    item: "副轴高速段转速",
    symbol: "k_1",
    unit: "",
    val: speedHMinorShaft,
  },


  {
    item: "副轴高速段功率",
    symbol: "Torque_{ms}",
    unit: "MW",
    val: computed(() => powerMinorShaft.value / 1000000),
  },
  {
    item: "副轴高速段扭矩",
    symbol: "Torque_{ms}",
    unit: "Nm",
    val: torqueHMinorShaft,
  },
  {
    item: "副轴高速段直径",
    symbol: "d_{mhs}",
    unit: "mm",
    val: dMinorShaftH_mm,
  },
  {
    item: "副轴低速段转速",
    symbol: "d_{mhs}",
    unit: "rpm",
    val: speedLMinorShaft,
  },
  {
    item: "副轴低速段直径",
    symbol: "d_{mhs}",
    unit: "mm",
    val: dMinorShaft_mm,
  },
  {item: "钢丝绳计算"},
  {
    item: "单个重物钢丝绳数量",
    symbol: "N_{rope}",
    unit: "根",
    val: numRopePerBlock,
  },
  {
    item: "动滑轮数量",
    symbol: "N_{pulley}",
    unit: "个",
    val: numPulleyPerRope,
  },
  {
    item: "钢丝绳安全系数",
    symbol: "f_{rs}",
    unit: "/",
    val: safetyRatioRope,
  },
  {
    item: "钢丝绳拉力",
    symbol: "F_{rope}",
    unit: "N",
    val: forceRope,
  },
  {
    item: "钢丝绳破断拉力",
    symbol: "F_{rb}",
    unit: "N",
    val: forceRopeBreak
  },

  {
    item: "钢丝绳直径",
    symbol: "D_{rope}",
    unit: "mm",
    val: diameterRope_mm,
    bak: "轴径计算参考https://www.mechtool.cn/manual/manual_shaftdesignmanual1stedition1993.html 第56页",
    children: [
      {
        item: "钢丝绳级",
        symbol: "Lvl_{r}",
        unit: "",
        formula: "",
        val: lvlRope,
      },
      {
        item: "钢丝绳类型",
        symbol: "Lvl_{r}",
        unit: "",
        formula: "",
        val: ropeClass,
      },
      {
        item: "钢丝绳股型号",
        symbol: "Lvl_{r}",
        unit: "",
        formula: "",
        val: ropeStrand,
      },
      {
        item: "钢丝绳芯类型",
        symbol: "Lvl_{r}",
        unit: "",
        formula: "",
        val: ropeCoreClass,
      },
    ]
  },

  {
    item: "钢丝绳导向段长度",
    symbol: "Lvl_{r}",
    unit: "",
    formula: "",
    val: lengthRopeGuidance,
  },
  {
    item: "钢丝绳总长度",
    symbol: "Lvl_{r}",
    unit: "",
    formula: "",
    val: lengthRope,
  },
  {
    item: "钢丝绳参考重量（kg/100m）",
    symbol: "M_{rr}",
    unit: "",
    formula: "",
    val: massRopePer100,
  },
  {
    item: "单根钢丝绳重量",
    symbol: "M_{r1}",
    unit: "kg/根",
    formula: "",
    val: massSingleRope,
  },
  {
    item: "钢丝绳数量",
    symbol: "n_{r}",
    unit: "根",
    formula: "",
    val: massSingleRope,
  },
  {
    item: "钢丝绳总重量",
    symbol: "M_{rt}",
    unit: "kg",
    val: massRopes,
  },

  {item: "轴的重量计算"},

  {
    item: "所有轴系总质量",
    symbol: "r_{gear}",
    unit: "t",
    val: computed(() => massShaftTotal.value / 1000),
  },
  {
    item: "主轴高速段长度",
    symbol: "r_{gear}",
    unit: "m",
    val: lengthMainShaft,
  },
  {
    item: "主轴高速段质量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMainShaft,
  },
  {
    item: "主轴高速段数量",
    symbol: "r_{gear}",
    unit: "个",
    val: numMainShaft,
  },
  {
    item: "主轴高速段总质量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMainShafts,
  },

  {
    item: "副轴高速段长度",
    symbol: "r_{gear}",
    unit: "m",
    val: lengthMinorShaftH,
  },
  {
    item: "单个副轴高速段质量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMinorShaftH,
  },
  {
    item: "副轴高速段数量",
    symbol: "n_{mHs}",
    unit: "个",
    val: numMinorShaftH,
  },
  {
    item: "副轴高速段总质量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMinorShaftHs,
  },
  {
    item: "副轴低速段长度",
    symbol: "r_{gear}",
    unit: "m",
    val: lengthMinorShaftL,
  },
  {
    item: "副轴低速段质量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMinorShaftL,
  },
  {
    item: "副轴低速段数量",
    symbol: "r_{gear}",
    unit: "个",
    val: numMinorShaftL,
  },
  {
    item: "副轴低速段总质量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMinorShaftLs,
  },
  {
    item: "副轴连接段长度",
    symbol: "r_{gear}",
    unit: "m",
    val: lengthMinorShaftL0,
  },
  {
    item: "副轴连接段重量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMinorShaftL0,
  },
  {
    item: "副轴连接段数量",
    symbol: "r_{gear}",
    unit: "个",
    val: numMinorShaftL0,
  },
  {
    item: "副轴连接段总质量",
    symbol: "r_{gear}",
    unit: "kg",
    val: massMinorShaftL0s,
  },


  {item: "卷筒计算"},

  {
    item: "卷筒直径",
    symbol: "d_{gear}",
    unit: "m",
    val: diameterReel,
  },
  {
    item: "卷筒卷线区长度",
    symbol: "d_{gear}",
    unit: "m",
    val: lengthReel,
  },
  {
    item: "卷筒卷周长",
    symbol: "d_{gear}",
    unit: "m",
    val: girthReel,
  },
  {
    item: "钢丝绳缠绕总圈数",
    symbol: "r_{gear}",
    unit: "kg",
    val: numRopeLaps,
  },
  {
    item: "每层可缠绕圈数",
    symbol: "r_{gear}",
    unit: "kg",
    val: numLapsPerLayer,
  },
  {
    item: "钢丝绳缠绕层数",
    symbol: "r_{gear}",
    unit: "kg",
    val: numRopeLayers,
  },

  {item: "价格计算"},

  {
    item: "钢丝绳单价",
    symbol: "r_{gear}",
    unit: "元/t",
    val: priceRope,
  },
  {
    item: "钢丝绳总价",
    symbol: "r_{gear}",
    unit: "元",
    val: priceRopes,
  },
  {
    item: "轴单价",
    symbol: "r_{gear}",
    unit: "元/t",
    val: priceShaft,
  },
  {
    item: "轴系总价",
    symbol: "r_{gear}",
    unit: "元",
    val: priceShafts,
  },

])
const window_height = window.innerHeight;
const table_height = ref(10000)
const rowClassName = (row: rowType) => {
  if (sepRow.includes(row.item)) {
    return "sep"
  } else {
    return ""
  }
}
const generate3D = () => {

}
</script>

<template>
  <div>
    <n-tag>方案1计算结果
      <button @click="generate3D">生成3D模型</button>
    </n-tag>
    <n-slider v-model:value="table_height" :min="200" :max="2000" :step="10" style="max-width: 100%"/>
    <n-data-table :columns="columns()"
                  :data="tableData"
                  :pagination="false"
                  :bordered="true"
                  :max-height="table_height"
                  :row-class-name="rowClassName"
                  striped default-expand-all
    />

  </div>
  <n-modal title="钢管混凝土参数" v-model:show="show_pillar_settings" preset="dialog">
    <n-form-item label="钢材材质">
      <n-flex vertical>
        <n-select v-model:value="pillar_set.steelType"
                  :options="generateOptions(base_data.pillar.steelType)"
        />
      </n-flex>
    </n-form-item>
    <n-form-item label="混凝土型号">
      <n-flex vertical>
        <n-select v-model:value="pillar_set.concreteType"
                  :options="generateOptions(base_data.pillar.concreteType)"
        />
      </n-flex>
    </n-form-item>
    <n-form-item label="含钢率">
      <n-flex vertical>
        <n-select v-model:value="pillar_set.steelRatio"
                  :options="generateOptions(base_data.pillar.compressionStrength.alpha)"
        />
      </n-flex>
    </n-form-item>
    <n-form-item label="安全系数">
      <n-flex vertical>
        <n-input-number v-model:value="pillar_set.safetyFactor" placeholder=""></n-input-number>
      </n-flex>
    </n-form-item>
  </n-modal>
  <!--  <n-modal title="设置" v-model:show="show_area_settings" preset="dialog">-->
  <!--    <n-form-item label="重物块与壁面预留距离">-->
  <!--      <n-flex vertical>-->
  <!--        <n-input-number v-model:value="distance_pillar_wall" placeholder=""></n-input-number>-->
  <!--      </n-flex>-->
  <!--    </n-form-item>-->
  <!--    <n-form-item label="发电机预留宽度">-->
  <!--      <n-flex vertical>-->
  <!--        <n-input-number v-model:value="width_generator" placeholder=""></n-input-number>-->
  <!--      </n-flex>-->
  <!--    </n-form-item>-->
  <!--    <n-form-item label="面积裕度系数">-->
  <!--      <n-flex vertical>-->
  <!--        <n-input-number v-model:value="area_coefficient" placeholder=""></n-input-number>-->
  <!--      </n-flex>-->
  <!--    </n-form-item>-->

  <!--  </n-modal>-->
</template>

<style scoped>

.n-tag {
  border: coral;
  background-color: coral;
  width: 100%;
}

.n-select {
  width: 370px;
  padding-top: 0;
}

.n-input {
  width: 370px;
  background-color: lightgreen !important;
}

:deep(.sep td) {
  background-color: aqua !important;
}

button {
  background-color: #646cff;
  color: black;
  border: 0;
  padding: 3px;
  margin: 100px;
  font-size: 16px;
  box-sizing: content-box;
  border-radius: 5px;
}

button:hover {
  background-color: #a54b4a;
}

</style>
